

package com.maoshi.shop.groupbuy.comment.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.maoshi.shop.groupbuy.comment.api.dto.ApiGroupSkuDto;
import com.maoshi.shop.groupbuy.comment.api.dto.ApiGroupSkuInfoDto;
import com.maoshi.shop.groupbuy.comment.dao.GroupSkuMapper;
import com.maoshi.shop.groupbuy.comment.model.GroupSku;
import com.maoshi.shop.groupbuy.comment.service.GroupSkuService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 拼团活动商品规格
 *
 * @author LGH
 * @date 2019-08-27 17:55:57
 */
@Service
@AllArgsConstructor
public class GroupSkuServiceImpl extends ServiceImpl<GroupSkuMapper, GroupSku> implements GroupSkuService {

    private final GroupSkuMapper groupSkuMapper;

    /**
     * 获取SKU列表数据
     * @param groupActivityId 拼团活动ID
     * @param prodId 商品ID
     * @return SKU列表
     */
    @Override
    public List<ApiGroupSkuDto> getApiByGroupActivityIdAndProdId(Long groupActivityId, Long prodId) {
        return groupSkuMapper.getApiByGroupActivityIdAndProdId(groupActivityId, prodId);
    }

    @Override
    public ApiGroupSkuInfoDto getSkuInfoByGroupSkuId(Long groupSkuId) {
        return groupSkuMapper.getSkuInfoByGroupSkuId(groupSkuId);
    }
}
